package com.yin.user.jpa;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.yin.user.entity.UserEntity;

/**
*@author LSY
*Time: 2018年12月26日上午11:31:07
*
*
*/
@Transactional
public interface UserJPA extends JpaRepository<UserEntity, Long>{

	@Query(value = "select * from users where u_password like %?1%", nativeQuery = true)
	public List<UserEntity> nativeQuery(String password);
	
	@Modifying
	@Query(value = "delete from users where u_username = ?1",nativeQuery = true)
	public void deleteQuery(String name);
}
